home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / i2p / eepsite / jetty-jmx.xml next >
Encoding:
Extensible Markup Language  |  2012-10-27  |  4.0 KB  |  90 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
  3.  
  4.  
  5. <!-- =============================================================== -->
  6. <!-- Configure the JVM JMX Server                                    -->
  7. <!-- this configuration file should be used in combination with      -->
  8. <!-- other configuration files.  e.g.                                -->
  9. <!--    java -jar start.jar etc/jetty-jmx.xml etc/jetty.xml          -->
  10. <!-- See jetty-jmx-mx4j.xml for a non JVM server solution            -->
  11. <!-- =============================================================== -->
  12. <Configure id="Server" class="org.mortbay.jetty.Server">
  13.  
  14.     <!-- =========================================================== -->
  15.     <!-- Initialize an mbean server                                  -->
  16.     <!-- =========================================================== -->
  17.     <!-- Use the jdk 1.5 platformMBeanServer -->
  18.     <Call id="MBeanServer" class="java.lang.management.ManagementFactory" name="getPlatformMBeanServer"/>
  19.  
  20.     <!-- =========================================================== -->
  21.     <!-- Initialize the Jetty MBean container                        -->
  22.     <!-- =========================================================== -->
  23.     <Get id="Container" name="container">
  24.       <Call name="addEventListener">
  25.         <Arg>
  26.           <New class="org.mortbay.management.MBeanContainer">
  27.             <Arg><Ref id="MBeanServer"/></Arg>
  28.             <Call name="start" />
  29.           </New>
  30.         </Arg>
  31.       </Call>
  32.     </Get>
  33.  
  34.     <!-- =========================================================== -->
  35.     <!-- Enable stats (why else are you using JMX?                                -->
  36.     <!-- Sneakily replace the top-level handler with a StatisticsHandler          -->
  37.     <!-- Note we could use AtomicStatisticsHandler in jetty-java5-stats.jar (4KB) -->
  38.     <!-- but it really isn't worth bundling it.                                   -->
  39.     <!-- http://blog.markfeeney.com/2010/10/jmx-statistics-in-jetty-6-6122.html   -->
  40.     <!-- =========================================================== -->
  41.     <Get id="oldhandler" name="handler"/>
  42.     <Set name="handler">
  43.       <New id="StatsHandler" class="org.mortbay.jetty.handler.StatisticsHandler">
  44.         <Set name="handler"><Ref id="oldhandler"/></Set>
  45.       </New>
  46.     </Set>
  47.  
  48.  
  49.     <!--
  50.     When setting up the JMXConnectorServer via RMI, two TCP ports are used to communicate with
  51.     the remote server:
  52.     * the rmiregistry port (by default 1099) from where the RMI stub is downloaded
  53.     * the rmi server port (by default randomly chosen) where the actual RMI communication happens
  54.     The JMXServiceURL for the default configuration is therefore:
  55.  
  56.     service:jmx:rmi:///jndi/rmi://<remotehost>:1099/jmxrmi
  57.  
  58.     In case a firewall is restricting port access, you need to make sure that the rmi server port
  59.     is not chosen randomly, and this can be specified with the following JMXServiceURL:
  60.  
  61.     service:jmx:rmi://<host>:2100/jndi/rmi://<host>:2099/jmxrmi
  62.  
  63.     where 2099 is the rmiregistry port and 2100 is the rmi server port.
  64.     Make sure the firewall allow access to those ports.
  65.  
  66.     When using the XML configuration below, you don't need to specify any of the JMX system properties
  67.     on the command line (see http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html).
  68.     -->
  69.  
  70.     <!-- Setup the RMIRegistry on a specific port
  71.     <Call id="rmiRegistry" class="java.rmi.registry.LocateRegistry" name="createRegistry">
  72.       <Arg type="int">2099</Arg>
  73.     </Call>
  74.     -->
  75.     <!-- Setup the JMXConnectorServer on a specific rmi server port
  76.     <Call id="jmxConnectorServer" class="javax.management.remote.JMXConnectorServerFactory" name="newJMXConnectorServer">
  77.       <Arg>
  78.         <New  class="javax.management.remote.JMXServiceURL">
  79.           <Arg>service:jmx:rmi://localhost:2100/jndi/rmi://localhost:2099/jmxrmi</Arg>
  80.         </New>
  81.       </Arg>
  82.       <Arg/>
  83.       <Arg><Ref id="MBeanServer"/></Arg>
  84.       <Call name="start"/>
  85.     </Call>
  86.     -->
  87.  
  88. </Configure>
  89.  
  90.